package com.cms.service.impl;

import com.cms.dao.ScheduleMapper;
import com.cms.entity.Schedule;
import com.cms.exception.DuplicateKeyException;
import com.cms.service.ScheduleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;

@Service
public class ScheduleServiceImpl implements ScheduleService {
    @Autowired
    private ScheduleMapper scheduleMapper;

    @Override
    public List<Schedule> findAll() {
        return scheduleMapper.findAll();
    }

    @Override
    public int insertSchedule(Schedule project) throws DuplicateKeyException {
        return scheduleMapper.insertSchedule(project);
    }

    @Override
    public int updateSchedule(HashMap<String, String> updateMap) throws DuplicateKeyException {
        return scheduleMapper.updateSchedule(updateMap);
    }

    @Override
    public int deleteSchedule(String id) {
        return scheduleMapper.deleteSchedule(id);
    }
}
